
import React, { Component } from 'react';
import { StyleSheet, Text, View, ScrollView, Dimensions, PropTypes } from 'react-native';
import ButtonActionFunction from './firstComponent/wrapButtonActionFunction';
import WrapButtonCard from './firstComponent/wrapButtonCard';
import Welcome from './welcome';
import TestFlexMode from './testMode';
import FirstPageView from './firstPageView';

const actionFunction = new ButtonActionFunction;
const _windows = Dimensions.get('window');

class HomePage extends Component {
    static propTypes = {

    }

    constructor(props, context) {
        super(props, context);
    };

    _onPressButton(index){
        const _router = actionFunction.getRouter(index);
        this.props.navigator.push(_router);
    };

    render() {
        return (
            <ScrollView style={styles.containerScrollView} >
               <View style={styles.container} >
                   <WrapButtonCard clickAction={this._onPressButton.bind(this)}/>
                   <Welcome/>
               </View>
            </ScrollView>
        );
    }
}

const styles = StyleSheet.create({
    containerScrollView: {
        backgroundColor: '#F5FCFF'
    },
    container: {
        flex: 1,
        justifyContent: 'flex-start',
        alignItems: 'center',
        borderColor:'#cccccc',
        borderBottomWidth:1,
        borderTopWidth:1,
        height:_windows.height
    }

});

export default HomePage;